package com.example.demomongodb.controller;

import com.example.demomongodb.entity.Student;
import com.example.demomongodb.form.StudentForm;
import com.example.demomongodb.service.StudentService;
import com.example.demomongodb.service.WelcomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version 1.0.0
 * @className: TestController
 * @description:
 * @author: zhangjunfa
 * @date: 2022/11/8 11:31
 */
// @CrossOrigin
@RestController
@RequestMapping("/student")
@Slf4j
public class StudentController {
    @Autowired
    private StudentService studentService;

    @PostMapping("/addTest")
    public Object addTest(Student student){
        return studentService.addStudent(student);
    }

    @PostMapping("/getTest")
    public Object getTest( StudentForm student){
        return studentService.getStudent(student);
    }

}
